/*
 * MessageTimeProvider.java
 * business
 *
 * Created by ChenTao on 2017/6/28.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.recyclerview.provider;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.yidiandao.business.R;

import me.drakeet.multitype.ItemViewProvider;

/**
 * MessageTimeProvider
 * <p>
 * Created by ChenTao(chentao7v@gmail.com) on 2017-06-28 18:15
 */
public class MessageTimeProvider extends ItemViewProvider<String, MessageTimeProvider.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        return new ViewHolder(inflater.inflate(R.layout.item_message_time, parent, false));
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull String time) {
        holder.tvTime.setText(time);
    }

    static class ViewHolder extends RecyclerView.ViewHolder {

        private TextView tvTime;

        public ViewHolder(View itemView) {
            super(itemView);
            tvTime = (TextView) itemView.findViewById(R.id.tv_time);
        }
    }
}
